<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@include file="../include/taglibs.jsp"%>

<fmt:message key="login.logo" var="logo" scope="page"/>
<fmt:message key="login.login" var="login" scope="page"/>
<fmt:message key="login.placeholderName" var="placeholderName" scope="page"/>
<fmt:message key="login.error.duplicateName" var="duplicateName" scope="page"/>

<c:url var="loginUrl" value="/j_spring_security_check" />
		
<h1 style="text-align:center">${logo}</h1>

<form method="post" action="${loginUrl}">

	<div style="text-align:center;">
		<input id="playername" type="text" name="j_username" style="width:200px" />
		<input type="submit" value="${login}" />
	</div>
	<input type="hidden" name="j_password" value="${sessionId}"/>
	
	<c:if test="${error}">
	 	<div style="text-align:center; color:red; margin-top:1em;">
    		${duplicateName}
    	</div>
    </c:if>
		
</form>

<script type="text/javascript">
    $(document).ready(function() {
        var playername = $('#playername');
        playername.val("${placeholderName}");
        playername.select();
    	playername.focus();
    });
</script>
